<template>
  <el-upload class="upload-demo uplad_file"
             action="/api/UploadMedia"
             :on-success="handleChange"
             accept=".doc,.docx,.pdf,.xls,.xlsx"
             :file-list="fileList">
    <el-button size="small"
               type="primary">点击上传附件</el-button>
    <!-- <div slot="tip"
         class="el-upload__tip">只能上传jpg/png文件，且不超过500kb</div> -->
  </el-upload>
</template>

<script>
export default {
    data() {
        return {
          fileList: []
        };
    },
    methods: {
        changeFile(file) {
            this.$emit('fileUrlChange', file);
        },
        handleChange(res,file) {
         //this.changeFile('http://' + res.data);
         this.changeFile(file);
        }
    }
};
</script>
<style>
.uploadFile .el-upload--text {
    width: 180px;
    height: 60px;
    border: 0px;
}
</style>